#include<SoftwareSerial.h>

//新建一个softSerial对象，rx:8,tx:9

SoftwareSerial softSerial1(8,9);
int a=0;
int flag=0;
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);

  //初始化软串口通信；

  softSerial1.begin(9600);
  pinMode(10,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
a=digitalRead(10);
if(a==1)
{
  delay(500);
  if(flag==0)
  {softSerial1.println("19990331ag");
  Serial.println("19990331ag");
  flag=1;
  }
  }

 if(a==0)
 flag=0; 
}
